package com.cd.service.contact.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cd.bean.Contact;
import com.cd.dao.ContactMapper;
import com.cd.service.contact.ContactService;

/**
 *联系我们
 *@Author zhk
 *@Date 2017-12-28
 **/
@Service("contactService")
public class ContactServiceImpl implements ContactService{

	@Autowired
	ContactMapper contactMapper;
	
	
	@Override
	public void save(Contact con) throws Exception {
		contactMapper.save(con);
	}

	@Override
	public void delete(Integer id) throws Exception {
		contactMapper.delete(id);
	}

	@Override
	public void edit(Contact con) throws Exception {
		contactMapper.update(con);
	}

	@Override
	public List<Contact> listAll() throws Exception {
		return contactMapper.queryByList();
	}

	@Override
	public Contact findById(Integer id) throws Exception {
		return contactMapper.query(id);
	}

	@Override
	public void deleteAll() throws Exception {
		
	}

	@Override
	public Integer size() throws Exception {
		return contactMapper.getCount();
	}

	@Override
	public List<Contact> listLimit() throws Exception {
		// TODO Auto-generated method stub
		return contactMapper.list();
	}

	@Override
	public void addOrUpdateImg(Contact con) {
		
		contactMapper.addOrUpdateImg(con);
	}

}
